// 2013-9-15下午02:56:45  net.betou.trade.entity.main.Config.java

package net.betou.trade.entity.main;

import java.util.Date;

import org.apache.commons.lang.StringUtils;

import net.betou.web.Constants;
import net.betou.trade.entity.main.base.BaseConfig;

/**
 * 
 * @author 叶装装
 */
public class Config extends BaseConfig{

	
	private static final long serialVersionUID = -1813489687928388119L;
	
	public Config( ){}
	
	public void init( ){
		this.setCreateDate( new Date( ) );
		this.setAdminTemplate( null );
		this.setFrontTemplate( null );
	}
	
	public String getSitename( ){
		String name = this.getName( );
		if( StringUtils.isBlank( name )){
			return Constants.DEFAULT_SITE_NAME;
		}
		
		return name;
	}
	
	public String getSitelogo( ){
		String logo = this.getLogo( );
		if( StringUtils.isBlank( logo )){
			return Constants.DEFAULT_LOGO;
		}
		
		if( !logo.startsWith( "/" )){
			logo = "/" + logo;
		}
		
		return logo;
	}

}
